import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: "/home",
      name: "Home",
      component: () => import("../views/home/HomeView.vue"),
    },
    {
      path: "/class",
      name: "Class",
      component: () => import("../views/class/ClassView.vue"),
    },
    {
      path: "/class/:id",
      name: "ClassId",
      component: () => import("../views/class/ClassView.vue"),
    },
    {
      path: "/cart",
      name: "Cart",
      component: () => import("../views/cart/CartView.vue"),
    },
    {
      path: "/my",
      name: "My",
      component: () => import("../views/my/MyView.vue"),
    },
    {
      path: "/goods/:id",
      name: "Goods",
      component: () => import("../views/goods/GoodsView.vue"),
    },
    {
      path: "/login",
      name: "Login",
      component: () => import("../views/login/LoginView.vue"),
    },
    {
      path: "/classify/:id",
      name: "Classify",
      component: () => import("../views/class/ClassifyView.vue"),
    },
  ],
});

export default router;
